<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>统计成绩最大值和最小值</title>
    <script>
        var arr = new Array(83, 75, 65, 59.5, 92);
        var sum = 0;
        var max = 0;
        var min = 100;

        for (var i = 0; i < arr.length; i++) {
            sum += arr[i];
            if (max < arr[i]) {
                max = arr[i]
            }
            if (min > arr[i]) {
                min = arr[i]
            }
        }

        document.write('五门成绩分别是：' + arr + '<br />')
        document.write('总分是：' + sum + '<br />')
        document.write('平均分是：' + (sum / 5) + '<br />')
        document.write('最高分：' + max + '<br />')
        document.write('最低分：' + min)
    </script>
</head>

<body>

</body>

</html>